<?php $this->load->view('common/cms-head'); ?>
<article id="content">
    <div class="pgwrapper">
    <div class="w960 bg1 p15 bx_shw">
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td width="20%" style="border-right: 2px solid #e5e5e5;" valign="top">
		<?php $this->load->view('enterprises/leftnavCMS'); ?>
		</td>
		<td width="80%"><form enctype="multipart/form-data"
				action="/addDeal" onsubmit="return validateForm()" method="POST">
				<table width="100%" border="0" cellpadding="5" cellspacing="0"
					style="padding-left: 20px;">
					<tr>
						<td class="txt-blck">Select Store:</td>
						 <td><select id="code_store" name="code_store" style="width: 200px;padding-top:5px;" class="setBgInput">
			                	<?php foreach ($allStoresArray as $temp){ ?>
								<option value="<?php echo $temp['store_id']; ?>">
								<?php echo $temp['store_name']; ?>
								</option>
								<?php } ?>		                	
			            	</select></td>
					</tr>
					<tr>
						<td class="txt-blck" width="30%">Deal Title:</td>
						<td width="70%"><input type="text" value="" name="coupon_name"
							id="coupon_name" class="setBgInput"   />
						</td>
					</tr>
					<tr>
						<td class="txt-blck">Deal Status:</td>
						<td><select id="coupon_status" name="coupon_status" style="width:90px;padding-top:5px;" class="setBgInput">
								<option value="Yes">Yes</option>
								<option value="No">No</option>
						</select></td>
					</tr>
					<tr>
						<td class="txt-blck" width="30%">Deal Banner:</td>
						<td width="70%"><input type="file" name="coupon_banner"
							id="coupon_banner" class="setBgInput"   />
						</td>
					</tr>
					<tr>
						<td valign="top" class="txt-blck">Deal Description:</td>
						<td><textarea style="width: 450px; height: 300px;" class="setBgInput"
								id="coupon_description" name="coupon_description"></textarea></td>
					</tr>
					<tr>
						<td class="txt-blck" width="30%">Deal AffilateUrl:</td>
						<td width="70%"><input type="text" value="" name="coupon_affurl"
							id="coupon_affurl" class="setBgInput" style="width:400px;"   />
						</td>
					</tr>
					<tr>
						<td valign="top" class="txt-blck">Coupon Start Date:</td>
						<td><input type="text" name="coupon_startdate" id="coupon_startdate" style="width: 100px"
							onfocus="javascript:NewCssCal('coupon_startdate','yyyymmdd','arrow',false,'24',false);"
							value=""
							readonly class="setBgInput" /> (yyyy/mm/dd)</td>
					</tr>
					<tr>
						<td valign="top" class="txt-blck">Coupon Expire Date:</td>
						<td><input type="text" name="coupon_expiredate" id="coupon_expiredate" style="width: 100px"
							onfocus="javascript:NewCssCal('coupon_expiredate','yyyymmdd','arrow',false,'24',false);"
							value=""
							readonly class="setBgInput" /> (yyyy/mm/dd)</td>
					</tr>
					<tr>
						<td></td>
						<td><input type="submit" name="code_submit" value="Submit" class="btn_bg" /></td>
					</tr>
				</table>
			</form></td>
	</tr>
</table>
</div>
</div>
</article>
<div class="clr-both spacer-10">&nbsp;</div>
<?php $this->load->view('common/cms-footer'); ?>
<script>

function validateForm(){
	var s = document.getElementById('code_store').value;
	if(s==""){
	alert("Choose atleast one Store");
	return false;
	}
	var x = document.getElementById('coupon_name').value;
	if(x==""){
	alert("Deal Title must be filled out.");
	return false;
	}
}
</script>
